﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;

namespace BugSysSolution.MasterPage
{
    public partial class Site : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Users us = Session["user"] as Users;
            if (us == null)
            {
                //Response.Redirect("~/Login.aspx");
            }
        }

        protected void btn_login_Click(object sender, EventArgs e)
        {
            Users us = Session["user"] as Users;
            if (us == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            if (us.IsAdmin == CommonCs.Exceptions.AdminYes.ToString())
            {
                Response.Redirect("~/DataManagement/EditUsers.aspx");
            }
        }

        protected void btn_cancel_Click(object sender, EventArgs e)
        {
            Session["user"] = null;
            Response.Redirect("~/Login.aspx");
        }
    }
}